import { getAction, deleteAction, putAction, putparamsAction, postAction, httpAction } from '@/api/manage'

// 生产工序
const productionProcessList = (params) => getAction('/jksaas-produce/produce/baseSetting/process/list', params)
const productionProcessAdd = (params) => postAction('/jksaas-produce/produce/baseSetting/process/add', params)
const productionProcessEdit = (params) => putAction('/jksaas-produce/produce/baseSetting/process/edit', params)
const productionProcessDetail = (params) => getAction('/jksaas-produce/produce/baseSetting/process/queryById', params)
const productionProcessDel = (params) => deleteAction('/jksaas-produce/produce/baseSetting/process/deleteBatch', params)
const getProgramList = (params) => getAction('/jksaas-produce/produce/baseSetting/process/queryProgramList', params)
const getSpecificationList = (params) => getAction('/jksaas-produce/produce/baseSetting/process/querySpecificationList', params)


//获取 生产工序分页 （作为查询条件）
const productionProcessPage = (params) => getAction('/jksaas-produce/produce/baseSetting/process/queryPageListByReferencedFrom', params)

// 工艺流程
const technologicalProcessList = (params) => getAction('/jksaas-produce/produce/baseSetting/technologicalProcess/list', params)
const technologicalProcessAdd = (params) => postAction('/jksaas-produce/produce/baseSetting/technologicalProcess/saveEntity', params)
const technologicalProcessEdit = (params) => putAction('/jksaas-produce/produce/baseSetting/technologicalProcess/editEntity', params)
const technologicalProcessDetail = (params) => getAction('/jksaas-produce/produce/baseSetting/technologicalProcess/queryById', params)
const technologicalProcessDel = (params) => deleteAction('/jksaas-produce/produce/baseSetting/technologicalProcess/deleteBatch', params)

// 工艺路线
const processRouteList = (params) => getAction('/jksaas-produce/produce/baseSetting/processRoute/list', params)
const processRouteAdd = (params) => postAction('/jksaas-produce/produce/baseSetting/processRoute/saveEntity', params)
const processRouteEdit = (params) => putAction('/jksaas-produce/produce/baseSetting/processRoute/editEntity', params)
const processRouteDetail = (params) => getAction('/jksaas-produce/produce/baseSetting/processRoute/queryById', params)
const processRouteDel = (params) => deleteAction('/jksaas-produce/produce/baseSetting/processRoute/deleteBatch', params)
const checkGoodById = (params) => getAction('/jksaas-produce/produce/baseSetting/processRoute/ifGoodsUsed', params) // 有工艺路线的物品

// 产品BOM信息
const productBomList = (params) => postAction('/jksaas-produce/produce/bom/queryByPage', params)
const productBomAdd = (params) => postAction('/jksaas-produce/produce/bom/add', params)
const productBomEdit = (params) => postAction('/jksaas-produce/produce/bom/edit', params)
const productBomDetail = (params) => getAction(`/jksaas-produce/produce/bom/${params}`)
const productBomDel = (params) => deleteAction('/jksaas-produce/produce/bom/delete', params)

// 车间信息
const workshopInformationList = (params) => getAction('/jksaas-produce/produce/baseSetting/produceWorkshop/list', params)
const workshopInformationAdd = (params) => postAction('/jksaas-produce/produce/baseSetting/produceWorkshop/add', params)
const workshopInformationEdit = (params) => putAction('/jksaas-produce/produce/baseSetting/produceWorkshop/edit', params)
const workshopInformationDetail = (params) => getAction('/jksaas-produce/produce/baseSetting/produceWorkshop/queryById',params)
const workshopInformationDel = (params) => deleteAction('/jksaas-produce/produce/baseSetting/produceWorkshop/deleteBatch', params)

// 替代料管理
const alternativeMaterialsList = (params) => getAction('/jksaas-produce/produce/produceGoodsReplace/queryByPage', params)
const alternativeMaterialsAdd = (params) => postAction('/jksaas-produce/produce/produceGoodsReplace/add', params)
const alternativeMaterialsEdit = (params) => postAction('/jksaas-produce/produce/produceGoodsReplace/edit', params)
const alternativeMaterialsDetail = (params) => getAction('/jksaas-produce/produce/produceGoodsReplace/getById',params)
const alternativeMaterialsDel = (params) => deleteAction('/jksaas-produce/produce/produceGoodsReplace/delete', params)

// 班次信息
const shiftInformationList = (params) => getAction('/jksaas-produce/produce/produceWorkClasses/queryByPage', params)
const shiftInformationAdd = (params) => postAction('/jksaas-produce/produce/produceWorkClasses/add', params)
const shiftInformationEdit = (params) => postAction('/jksaas-produce/produce/produceWorkClasses/edit', params)
const shiftInformationDetail = (params) => getAction('/jksaas-produce/produce/produceWorkClasses/getById',params)
const shiftInformationDel = (params) => deleteAction('/jksaas-produce/produce/produceWorkClasses/delete', params)

// 班组信息
const teamInformationList = (params) => getAction('/jksaas-produce/produce/produceWorkTream/queryByPage', params)
const teamInformationAdd = (params) => postAction('/jksaas-produce/produce/produceWorkTream/add', params)
const teamInformationEdit = (params) => postAction('/jksaas-produce/produce/produceWorkTream/edit', params)
const teamInformationDetail = (params) => getAction('/jksaas-produce/produce/produceWorkTream/getById',params)
const teamInformationDel = (params) => deleteAction('/jksaas-produce/produce/produceWorkTream/delete', params)

// 生产日历
const productionCalendarList = (params) => getAction('/jksaas-produce/produce/produceCalendar/list', params)
const productionCalendarAdd = (params) => postAction('/jksaas-produce/produce/produceCalendar/add', params)
const productionCalendarEdit = (params) => putAction('/jksaas-produce/produce/produceCalendar/edit', params)
const productionCalendarDetail = (params) => getAction('/jksaas-produce/produce/produceCalendar/queryById',params)
const productionCalendarDel = (params) => deleteAction('/jksaas-produce/produce/produceCalendar/delete', params)
const productionCalendarDels = (params) => deleteAction('/jksaas-produce/produce/produceCalendar/deleteBatch', params)
// 获取法定节假日
const productionCalendarqueryHoliday = (params) => getAction('/jksaas-produce/produce/produceCalendarHoliday/queryHoliday', params)

// 计件单价
const pieceRateList = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/list', params)
const pieceRateAdd = (params) => postAction('/jksaas-produce/produce/producepiecerate/producePieceRate/add', params)
const pieceRateEdit = (params) => putAction('/jksaas-produce/produce/producepiecerate/producePieceRate/edit', params)
const pieceRateDetail = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/queryById',params)
const pieceRateDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)

// 生产工单
const productionOrderList = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/list', params)
const productionOrderAdd = (params) => postAction('/jksaas-produce/produce/producepiecerate/producePieceRate/add', params)
const productionOrderEdit = (params) => putAction('/jksaas-produce/produce/producepiecerate/producePieceRate/edit', params)
const productionOrderDetail = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/queryById',params)
const productionOrderDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)

// 工艺路线变更记录
const processChangeList = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/list', params)
const processChangeAdd = (params) => postAction('/jksaas-produce/produce/producepiecerate/producePieceRate/add', params)
const processChangeEdit = (params) => putAction('/jksaas-produce/produce/producepiecerate/producePieceRate/edit', params)
const processChangeDetail = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/queryById',params)
const processChangeDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)

// 工艺路线变更记录
const productionBatchList = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/list', params)
const productionBatchAdd = (params) => postAction('/jksaas-produce/produce/producepiecerate/producePieceRate/add', params)
const productionBatchEdit = (params) => putAction('/jksaas-produce/produce/producepiecerate/producePieceRate/edit', params)
const productionBatchDetail = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/queryById',params)
const productionBatchDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)

// 生产报工
const productionReportingDetail = (params) => getAction('/reportwork/produceOrderReportWork/workbench',params)
const ordlistTable = (params) => postAction('/produce/produceOrderTask/list',params)
const ordlistTables = (params) => postAction('/reportwork/produceOrderReportWork/list',params)
const productionReportingDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)
const workOrder = (params) => getAction('/jksaas-produce/produce/produceManagement/workOrder/list', params)
const processMessage = (params) => getAction('/jksaas-produce/produce/management/productionTask/processMessage', params)

// 退料
const materialReturnList = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/list', params)
const materialReturnAdd = (params) => postAction('/jksaas-produce/produce/producepiecerate/producePieceRate/add', params)
const materialReturnEdit = (params) => putAction('/jksaas-produce/produce/producepiecerate/producePieceRate/edit', params)
const materialReturnDetail = (params) => getAction('/jksaas-produce/produce/producepiecerate/producePieceRate/queryById',params)
const materialReturnDel = (params) => deleteAction('/jksaas-produce/produce/producepiecerate/producePieceRate/deleteBatch', params)

export {
  productionProcessList,
  productionProcessAdd,
  productionProcessEdit,
  productionProcessDetail,
  productionProcessDel,
  productionProcessPage,
  getProgramList,
  getSpecificationList,

  technologicalProcessList,
  technologicalProcessAdd,
  technologicalProcessEdit,
  technologicalProcessDetail,
  technologicalProcessDel,

  productBomList,
  productBomAdd,
  productBomEdit,
  productBomDetail,
  productBomDel,

  workshopInformationList,
  workshopInformationAdd,
  workshopInformationEdit,
  workshopInformationDetail,
  workshopInformationDel,

  alternativeMaterialsList,
  alternativeMaterialsAdd,
  alternativeMaterialsEdit,
  alternativeMaterialsDetail,
  alternativeMaterialsDel,

  shiftInformationList,
  shiftInformationAdd,
  shiftInformationEdit,
  shiftInformationDetail,
  shiftInformationDel,

  teamInformationList,
  teamInformationAdd,
  teamInformationEdit,
  teamInformationDetail,
  teamInformationDel,

  productionCalendarList,
  productionCalendarAdd,
  productionCalendarEdit,
  productionCalendarDetail,
  productionCalendarDel,
  productionCalendarDels,
  productionCalendarqueryHoliday,

  pieceRateList,
  pieceRateAdd,
  pieceRateEdit,
  pieceRateDetail,
  pieceRateDel,

  processRouteList,
  processRouteEdit,
  processRouteDetail,
  processRouteDel,
  processRouteAdd,
  checkGoodById,

  productionOrderList,
  productionOrderAdd,
  productionOrderEdit,
  productionOrderDetail,
  productionOrderDel,

  processChangeList,
  processChangeAdd,
  processChangeEdit,
  processChangeDetail,
  processChangeDel,

  productionBatchList,
  productionBatchAdd,
  productionBatchEdit,
  productionBatchDetail,
  productionBatchDel,

  productionReportingDetail,
  productionReportingDel,
  workOrder,
  processMessage,

  materialReturnList,
  materialReturnAdd,
  materialReturnEdit,
  materialReturnDetail,
  materialReturnDel,
  ordlistTable,
  ordlistTables
}
